home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 71.zip
/
BS1 part 71
/
X-Cad3000_d5.adf
/
XCdoc
/
deftext
< prev
next >
Wrap
Text File
|
1991-11-22
|
8KB
|
164 lines
13.1 DEFINE TEXT
The DEFINE TEXT command is used to create or modify an X-CAD text font.
DEFINE TEXT allows you to design any type of character style by drawing the
characters using X-CAD primitive entities and then saving each character
definition to an X-CAD text font file.
Defining a new text font or adding or modifying a character in an existing
text font requires that a certain procedure is followed. Each step of this
procedure is described below.
Step 1 If this is going to be a new text font, the character tile size
must be decided upon at this stage. The tile size is a rectangle
which is used to fit all characters of the font. The size itself
is not important, but the proportion of the rectangle in terms of
width to height is. The tile size is used to lay out characters
when uniform spacing is used, therefore if this font is going to be
used with uniform spacing, the tile size should be chosen to fit
the character with the largest extents in height and width such as
the M or W characters.
The STANDARD text font used by X-CAD uses a character tile size
which is proportioned 3:2 ( height:width ). None of the characters
in this font exceed this proportion in their width, so this font
is suitable for uniform spacing as there will be no overlap of
characters in each tile.
If uniform spacing is not important in a new font, a tile size
should be chosen to suit an 'average' character such as the A or
P characters. These characters generally have the same height to
width proportion as about 75% of a complete character set. ( See
fig. 13.1 ).
Step 2 The next stage is to draw the character itself. To aid in laying
out the character, it is best to draw a rectangle in the same
proportion as the tile size first. The character can then be
drawn using the tile as a reference.
The character graphics can be drawn using line, string, arc or
ellipse entities. No other entity types will be valid when the
character is defined.
The position of the character graphics in relation to the tile is
important. If uniform character spacing is required, then the
character should always be positioned centrally in the tile. If
uniform spacing is not so important, characters should be
positioned centrally if they are narrower than the chosen tile
size, or starting at the left edge of the tile if they are wider
than the tile size. The bottom of the tile is used as the
character base-line, so lowercase character such as g or y should
be positioned with the descender below the tile.
The size of the character or the units used when the character is
drawn is immaterial as the DEFINE TEXT command only needs to know
the proportions of the character tile and the position of the
character graphics relative to the tile.
Step 3 Once the character has been drawn, the graphics can be used to
add the character to the font file using DEFINE TEXT. The command
input prompt varies if this is a new or an old text font:
#DEFINE TEXT modifiers :Tile centre/height/width x1 x2 :
for a new font, or
#DEFINE TEXT modifiers :Tile centre/height x1 x2 :
for an existing font. For a new font, two locations are entered to
define the character tile size. If a reference tile has been
drawn, then this is the bottom left corner ('x1') and the top
right corner ('x2') of the reference tile. Ocne these proportions
have been set when the first character of a new font is defined,
they cannot be changed. For an existing font only the tile centre
and height is required as the proportion of the tile is already
known. If a reference tile has been drawn, then this is the bottom
left corner ('x1') and the top left corner ('x2').
Step 4 The full command format for DEFINE TEXT is:
#DEFINE TEXT modifiers :Tile centre/height.. x1 x2 :
Character extents x3 x4 :
Ent x5 x6 ... xn [:
Ent x7 ... ]
When the two locations used to define the tile centre and height/
width are entered, a colon must be input to move to the next stage.
The next prompt to appear will be 'Character extents', this
requires a window whose extents are defined by the locations 'x3'
and 'x4' to be entered. The window is used to indicate how the
character graphics extents relate to the character tile in size
and position. The window must be entered so that it bounds all of
the entities used to draw the character itself.
The character extents window may exceed the extents of the
character tile to the top, bottom and right sides only. It may
not extend beyond the left edge of the tile.
Step 5 The last stage is to identify which entities make up the character
graphics. The entities are not all identified at the same time,
but are identified in individual groups each separated by a colon
in IDENTS. Each group is used to identify a set of entities that
constitute a continuous border, the last group is terminated by a
return and not a colon.
The entities in a single group must all have matching endpoints
such that they become a chain of individual entities defining a
continuous boundary shape. The entities must also be identified in
the order that they make up the chain. For example, the letter A
can be drawn using two string entities: one for the sides of the
triangle and a second for the horizontal stroke. The two strings
must be identified in two separate groups as the horizontal stroke
of the A does not join any endpoint or form a continuous boundary
with the triangle part of the A.
If the letter P is drawn using a line and an arc, the two entities
may be identified as a single group because the top of the line
used as the vertical for the P joins the end of the arc used as
the loop for the P. Therefore these two entities can be merged to
form one boundary used to define the graphics of the character.
When defining double line characters, it is important that any
entities that are chained together to form outer and inner polygons
are completely closed. If the polygons are not closed, the
character cannot be filled.
( See fig. 13.2 ).
The above steps are repeated for each character to be defined. DEFINE TEXT
can only be used to define one character at a time. The characters space and
carriage-return are always defined automatically.
When a text font is used in any command, the font is cached in memory to
save having to be accessed from disk the next time the same font is
required. If you use DEFINE text on a font that is already chached, any
modifications made will not come into effect until next time X-CAD is
entered from system level.
MODIFIERS
FONT Requires the name of the text font to be created or modified.
The font name can consist of up to 8 alphabetic characters.
CHARACTER The character to define. This is simply entered as one
character:
#DEFINE TEXT FONT xxxx CHARACTER A :
to define the character A for font xxxx.
HEXCHAR If the character to be defined is not accessible from the
keyboard, it can be entered in its hexadecimal equivalent by
entering a two character hexadecimal value.